import React from 'react';
import styles from './index.less';

const InfoList = ({ dataSource = [] }) => (
    <div className={styles.infoWrap}>
        {dataSource.map(item => (
            <div
                key={item.label}
                className={styles.infoItem}
                style={{ width: item.cols ? `${(item.cols * 100) / 24}%` : '100%' }}
            >
                <div className={styles.infoItemLabel}>{item.label}</div>
                <div>：</div>
                <div className={styles.infoItemValue}>{item.value}</div>
            </div>
        ))}
    </div>
);

export default InfoList;
